package com.hejing.初识泛型;

/**
 * ClassName: MyDate
 * Package: com.hejing.初识泛型
 * Description:
 *  MyDate类包含:
 *      private成员变量: year、month、day;
 *      为每一个属性定义getter、setter方法
 * @Author: HeJing
 * @Create: 2023-05-21 19:11
 * @Version: 1.0
 */
public class MyDate {

    private int year;
    private int month;
    private int day;

    public MyDate(){

    }

    public MyDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    // toString
    @Override
    public String toString() {
        return year + "-" + month + "-" + day;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }
}

























